************
Installation
************

.. highlight:: none


LICENSE
=======

SieveManager is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SieveManager is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the :doc:`GNU General Public
License <licence>` for more details.


REQUIREMENTS
============

* A Unix-like operating system (e.g., BSD, illumos, Linux, or macOS).

* Python_ ≥ v3.9.

* When installing from the tarball_,
  the `Package Installer for Python`_ (:command:`pip`)


DEBIAN PACKAGE
==============

The Debian package targets Debian ≥ v11 ("bullseye")
and systems based on Debian ≥ v11.

Add my repository and install SieveManager:

.. code:: bash

    sudo curl -o /etc/apt/trusted.gpg.d/org_codeberg_odkr.asc \
        https://codeberg.org/api/packages/odkr/debian/repository.key &&

    sudo tee /etc/apt/sources.list.d/org_codeberg_odkr.list <<EOF &&
    deb https://codeberg.org/api/packages/odkr/debian bullseye main
    EOF

    sudo apt-get update &&
    sudo apt-get install sievemgr


TARBALL
=======

Preparation
-----------

Import my `PGP key`_, so that you can check whether
the tarball has been tampered with:

.. code:: bash

    gpg --recv-key 8975B184615BC48CFA4549056B06A2E03BE31BE9

This need, and should, only be done once.


Download
--------

Download, verify, and unpack the tarball:

.. code:: bash

    package='sievemgr'
    version='0.7.4.2'
    downloads="https://codeberg.org/odkr/$package/releases/download/v$version"
    tarball="$package-$version.tgz"
    signature="$tarball.asc"

    curl -O "$downloads/$tarball"   &&
    curl -O "$downloads/$signature" &&
    gpg --verify "$signature"       &&
    tar -xzf "$tarball"

Go to the top-level directory of the package to proceed with the installation:

.. code:: bash

   cd "${release:?}"

.. TIP::
    Subscribe to https://codeberg.org/odkr/sievemgr/releases.rss
    to be notified about new releases.


.. highlight:: bash

.. include:: ../INSTALL.rst


EXTRAS
======

Bash completion
---------------

The :download:`Bash completion script <../comp/sievemgr.bash>`
should work automatically if bash-completion_ is installed.

However, it can also be loaded by adding, for example,

.. code:: bash

    source "$HOME/.local/share/bash-completion/completions/sievemgr.bash"

to your :file:`.bashrc`.


Zsh completion
--------------

The :download:`Zsh completion script <../comp/sievemgr.zsh>`
targets Zsh's `modern completion system <Zsh completion_>`_.

It can be activated by adding, for example,

.. code:: zsh

    fpath+=("$HOME/.local/share/zsh-completions")

    autoload -Uz compinit
    compinit

to your :file:`.zshrc`.

